<script src="../../assets/format.js"></script>
<template>
     <div>
          <el-timeline>
               <el-timeline-item v-for="item in recordDetail" :key="item.actionRecordId" :timestamp="item.actionDate | format_date" placement="top" color="#008080">
                    <el-card>
                         <el-tag effect="dark">{{item.actionType.actionTypeName}}<i class="iconfont icon-changyongicon-" style="font-size: inherit">{{item.contact.contactName}}</i></el-tag>
                         <h4 style="margin:10px 0 ">
                              <span v-for="i in item.behaviorRecordList" :key="i.behaviorRecordId">
                                   {{i.behavior.behaviorName}};{{i.behaviorCont}}
                              </span>
                         </h4>
                         <p>{{item.emp.empName}} 提交于 {{item.actionDate | formatDate}}</p>
                    </el-card>
               </el-timeline-item>
<!--               <el-timeline-item timestamp="2018/4/12" placement="top" color="#008080">-->
<!--                    <el-card>-->
<!--                         <el-tag effect="dark">销售类行动<i class="iconfont icon-changyongicon-" style="font-size: inherit">马云</i></el-tag>-->
<!--                         <h4 style="margin:10px 0 ">仔细交流，并询问了详情;仔细交流，并询问了详情;仔细交流，并询问了详情;仔细交流，并询问了详情;仔细交流，并询问了详情;仔细交流，并询问了详情;仔细交流，并询问了详情;</h4>-->
<!--                         <p>哈鲁 提交于 2018/4/12 20:46</p>-->
<!--                    </el-card>-->
<!--               </el-timeline-item>-->
          </el-timeline>
     </div>
</template>

<script>
     import {formatTimeToStr} from '@/assets/format.js'
    export default {
         name: "actFlow",
         props:["action"],
         data:function(){
               return{
                    recordDetail:[],
               }
         },
         methods:{
               getcus_behavior(){
                    this.axios.get("api/actrecord/allrecord",{params:{"customerId":this.action}})
                            .then(res=>{
                                   this.recordDetail = res.data;
                                   window.console.log(this.recordDetail)
                            }).catch(()=>{
                                   this.global.mes_error("获取数据失败！")
                    })
               }
         },
         created:function() {
              this.getcus_behavior();
         },
         filters: {
              formatDate: function(time) {
                   if(time!=null&&time!="")
                   {
                        var date = new Date(time);
                        return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
                   }else{
                        return "";
                   }
              }
         }
    }
</script>

<style scoped>

</style>